package com.gildedrose.vo;

public class Quality {
    public static final Quality SULFURAS_QUALITY = new Quality(80);

    private int quality;

    private Quality(int quality) {
        this.quality = quality;
    }

    public static Quality create(int quality) {
        // 物品的品质`Quality`永远不会为负值, 并且永远不会超过50
        if (quality < 0 || quality > 50) {
            throw new IllegalArgumentException("quality < 0 || quality > 50");
        }
        return new Quality(quality);
    }

    public int getValue() {
        return quality;
    }
}
